package frame.system.mapper;

import frame.system.to.ConfParam;
import frame.system.qo.ConfQo;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 对应表：sys_conf_param 对应实体类：ConfParam
 * <br>
 * @author PeiWentao
 * @since 2020-10-01 23:13
 */
@Repository
public interface ConfParamMapper extends Mapper<ConfParam> {

	// 字段
    String FIELDS = "t.name,t.int_val,t.dou_val,t.str_val,t.description,t.valid,t.create_time,t.update_time,t.id";
    // 表名 as 别名
    String TABLE = "sys_conf_param t";
    // mapper包名
    String PACKAGE = "frame.system.mapper";

    @Results({
        @Result(column = "id", property = "id",id = true)
    })
    @Select({"<script>SELECT ", FIELDS, " FROM ", TABLE,
            " WHERE t.valid=${valid}",
            " ORDER BY ${orderStr}",
            "</script>"})
	List<ConfParam> pageList(ConfQo qo);
}
